package com.shxy.dao.common;

import com.shxy.entity.common.DepartmentBean;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 部门访问接口
 */
@Repository
public interface DepartmentDao extends JpaRepository<DepartmentBean, String> {
    /**
     * 根据编号查询
     * @param code
     * @return
     */
    DepartmentBean findByCode(String code);

    /**
     * 根据名称查询
     * @param name
     * @return
     */
    DepartmentBean findByName(String name);

    /**
     * 根据级别查询
     * @param level
     * @return
     */
    List<DepartmentBean> findAllByLevel(int level);
}
